/**
 * @Copyright (C) 2018 本内容属于商业秘密，易微行(北京)科技有限公司拥有版权等所有权利.
 */
package com.xxy.orders.rabitmq;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * xuxy
 * 2018/2/11
 */
@Component
public class RabbitMQSender {

    @Autowired
    AmqpTemplate amqpTemplate;

    /**
     * 指定发送
     * @param content
     */
    public void directSender(String content){
        amqpTemplate.convertAndSend("directQueue" , content);
    }

    /**
     * 多个接受端
     * @param content
     */
    public void topicSender(String content){
        amqpTemplate.convertAndSend("exchange", "topic.message", content);
    }

}